feat(setup-steward): drive family pre-select from repo fit signals#242
Open
andreahlert wants to merge 1 commit into
Open
feat(setup-steward): drive family pre-select from repo fit signals#242andreahlert wants to merge 1 commit into
andreahlert wants to merge 1 commit into
Conversation
Today Step 5's pre-selection of opt-in families (security, pr-management, issue) is derived only from prose in the user's adopt request. For an operator that just says 'adopt apache-steward', no family is pre-ticked, and the operator has to map repo health to families themselves. Add Step 4b: a best-effort, time-boxed signal collection that runs after the committed lock is written but before the family prompt. It reads cheap fit signals via gh against the canonical remote (open issues, open PRs, security-labeled count, oldest PR age, 30d merge ratio) plus filesystem markers (SECURITY.md, .asf.yaml), and produces <signal-derived-families> using the existing family descriptions as rules: - security: SECURITY.md present OR security-labeled count > 0 - pr-management: open PRs >= 5, oldest PR >= 30d, or 30d merge ratio < 0.5 - issue: open issues >= 10 or oldest issue >= 60d Step 5's pre-select rule is amended to union prose-named families with <signal-derived-families>, and to surface in the prompt body why each tick is on (named or signal). The operator can untick anything that does not fit. The flag skill-families: still wins when passed. The step is strictly optional: it skips on missing gh, unauthenticated gh, non-GitHub remote, or per-call timeout, and treats each missing signal as zero. Recommendation remains suggestion, never auto-decision. Includes the Pattern 4 injection-guard callout for the external content read via gh.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
setup-steward adoptStep 5 today picks default opt-in families (security,pr-management,issue) from prose the user typed in their adopt request. An operator that just says "adopt apache-steward" gets no pre-tick, and has to map repo health to families themselves. That is the single biggest piece of unhelpful friction in first-time adoption.What
Adds Step 4b — Read fit signals (FRESH only) between the committed-lock write and the family prompt. Best-effort, time-boxed signal collection via
ghagainst the canonical remote (upstreampreferred overorigin):SECURITY.md,.asf.yamlRules that produce
<signal-derived-families>:securityifSECURITY.mdpresent or security-labeled count> 0pr-managementif open PRs>= 5or oldest PR>= 30dor 30d merge ratio< 0.5issueif open issues>= 10or oldest issue>= 60dStep 5's pre-select rule is amended to union prose-named families with
<signal-derived-families>, and to surface in the prompt body why each tick is on (named or signal). The operator can untick anything that does not fit. Theskill-families:flag still wins verbatim when passed.Failure / skip behaviour
The whole step skips, and Step 5 falls back to today's prose-only default, when any of:
skill-families:ghmissing, unauthenticated, ororigin/upstreamnot a GitHub remoteRecommendation remains suggestion, never auto-decision.
Security
Includes the Pattern 4 injection-guard callout: counts and dates are the only fields consumed; free-text fields (titles, labels, logins) are discarded after extraction. No instructions are followed from gh content.
Scope
Single file change:
.claude/skills/setup-steward/adopt.md. No new sub-action, noSKILL.mddispatch edit, no behaviour change for adopters that passskill-families:or that have no GitHub remote.How tested
prek run --files .claude/skills/setup-steward/adopt.mdclean (markdownlint, typos, check-placeholders, skill-validate all pass).